<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>

    </style>
</head>
<body>
    <div id="app">  </div>
    <template id="my-app">
         <!-- v-on绑定事件 -->        <!-- @为v-on的简写 -->
        <!-- <button v-on:click="handle">按钮</button>       



        <button @click="add">{{count}}</button>

        <div @click="handle" @mouseenter="enter" style="width: 100px;height: 100px;border: 1px solid black;"></div>
        <div @="{click:handle,mouseenter:enter}" @mouseenter="enter" style="width: 100px;height: 100px;border: 1px solid black;"></div> -->

        <button @click="handleClick($event,'军儿',18)">按钮</button>

    </template>

    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
    <script>
        const App = {
            template:'#my-app',
            data(){
                return {
                    count:0
                }
            },
            methods:{
                handleClick(e,name,age) {
                    console.log(e,name,age);
                },
                handle() {
                    console.log('点击了按钮');
                },
                add() {
                    this.count++
                },
                enter() {
                    console.log('鼠标进入了div');
                }
            }
        }
        Vue.createApp(App).mount('#app')
    </script>
</body>
</html>